﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using KingNET.Controls;

namespace KingNET.Engine
{
    class CardComparer : IComparer<Card>
    {
        public int Compare(Card x, Card y)
        {

            int valueComp = x.CardValue.CompareTo(y.CardValue);
            int suitComp = x.Suit.CompareTo(y.Suit);
            int compValue = valueComp;

            
            switch (suitComp)
            {
                case -1:
                    {
                        compValue = -1;
                        break;
                    }
                case 1:
                    {
                        compValue = 1;
                        break;
                    }

            }

            return compValue;
        }

    }
}
